INCLUDE(BuildApplication)
INCLUDE(WindowsBuildHelpers)

BUILD_APPLICATION(veyon-service ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp)

ADD_WINDOWS_RESOURCE(veyon-service)
MAKE_GRAPHICAL_APP(veyon-service)

IF(VEYON_BUILD_LINUX)
    CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/veyon.service.in ${CMAKE_CURRENT_BINARY_DIR}/veyon.service @ONLY)
	IF(NOT SYSTEMD_SERVICE_INSTALL_DIR)
		SET(SYSTEMD_SERVICE_INSTALL_DIR /lib/systemd/system)
	ENDIF()
	INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/veyon.service DESTINATION ${SYSTEMD_SERVICE_INSTALL_DIR})
ENDIF()

